package com.ruoyi.blog.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.blog.mapper.BizArticleLoveMapper;
import com.ruoyi.blog.domain.BizArticleLove;
import com.ruoyi.blog.service.IBizArticleLoveService;
import com.ruoyi.common.core.text.Convert;

/**
 * 喜爱标记Service业务层处理
 * 
 * @author wsa
 * @date 2019-10-20
 */
@Service
public class BizArticleLoveServiceImpl implements IBizArticleLoveService 
{
    @Autowired
    private BizArticleLoveMapper bizArticleLoveMapper;

    /**
     * 查询喜爱标记
     * 
     * @param id 喜爱标记ID
     * @return 喜爱标记
     */
    @Override
    public BizArticleLove selectBizArticleLoveById(Long id)
    {
        return bizArticleLoveMapper.selectBizArticleLoveById(id);
    }

    /**
     * 查询喜爱标记列表
     * 
     * @param bizArticleLove 喜爱标记
     * @return 喜爱标记
     */
    @Override
    public List<BizArticleLove> selectBizArticleLoveList(BizArticleLove bizArticleLove)
    {
        return bizArticleLoveMapper.selectBizArticleLoveList(bizArticleLove);
    }

    /**
     * 新增喜爱标记
     * 
     * @param bizArticleLove 喜爱标记
     * @return 结果
     */
    @Override
    public int insertBizArticleLove(BizArticleLove bizArticleLove)
    {
        bizArticleLove.setCreateTime(DateUtils.getNowDate());
        return bizArticleLoveMapper.insertBizArticleLove(bizArticleLove);
    }

    /**
     * 修改喜爱标记
     * 
     * @param bizArticleLove 喜爱标记
     * @return 结果
     */
    @Override
    public int updateBizArticleLove(BizArticleLove bizArticleLove)
    {
        bizArticleLove.setUpdateTime(DateUtils.getNowDate());
        return bizArticleLoveMapper.updateBizArticleLove(bizArticleLove);
    }

    /**
     * 删除喜爱标记对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBizArticleLoveByIds(String ids)
    {
        return bizArticleLoveMapper.deleteBizArticleLoveByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除喜爱标记信息
     * 
     * @param id 喜爱标记ID
     * @return 结果
     */
    @Override
    public int deleteBizArticleLoveById(Long id)
    {
        return bizArticleLoveMapper.deleteBizArticleLoveById(id);
    }
}
